package com.example.onlinemusicserver2024.controller;

import com.example.onlinemusicserver2024.common.R;
import com.example.onlinemusicserver2024.service.ListSongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ListSongController {

    @Autowired
    ListSongService listSongService;

    /**
     * 根据歌单id查询歌曲列表
     * @param songListId
     * @return
     */
    @GetMapping("/listSong/detail")
    public R getSongsByListSongId(@RequestParam int songListId) {
        System.out.println("根据歌单id查询歌曲列表，id=" + songListId);
        R result = listSongService.getSongsByListSongId(songListId);
        return result;
    }
}
